diff options
| author | Adam Soltys <[email protected]> | 2026-02-27 23:45:57 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-27 23:45:57 -0800 |
| commit | a13df7e6333514843a12832f6d75ce5a4a8eade9 (patch) | |
| tree | 66685c5487ee571e18e0e18575ca2608d4a04273 /src/routes/(app)/[username]/(profile) | |
| parent | 7f52cb3b1613e8acb50755483ef210a4f9e15ac3 (diff) | |
| download | coinos-ui-a13df7e6333514843a12832f6d75ce5a4a8eade9.tar.gz coinos-ui-a13df7e6333514843a12832f6d75ce5a4a8eade9.zip | |
ui updates
Diffstat (limited to 'src/routes/(app)/[username]/(profile)')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+layout.svelte | 132 |
1 files changed, 7 insertions, 125 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 168be9b2..df63051f 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -1,29 +1,19 @@ <script lang="ts"> - import { copy, f, loc, post, s, sats, success, fail } from "$lib/utils"; - import { fiat } from "$lib/store"; - import { t } from "$lib/translations"; - import { bech32 } from "@scure/base"; - import { page } from "$app/stores"; - import { PUBLIC_DOMAIN } from "$env/static/public"; + import { f, loc, post, s, sats, success, fail } from "$lib/utils"; let { data, children } = $props(); - let { encode, toWords } = bech32; - let { rates, user, subject } = $derived(data); let rate = $derived(rates[subject.currency]); let { events, src, text } = $derived(data as any); let satsPerCurrency = $derived((1 * sats) / rate); - let { currency, npub, username: n, display } = $derived(subject); + let { currency, username: n, display } = $derived(subject); let locale = $derived(loc(user)); let showBio = $state(); let toggleBio = () => (showBio = !showBio); - let showDetails = $state(); - let toggleDetails = () => (showDetails = !showDetails); - let password = $state(); let reset = async (e) => { @@ -38,33 +28,19 @@ let stripped = $derived(n.replace(/\s/g, "")); let username = $derived(n.length > 60 ? n.substr(0, 6) : display || stripped); - let lnaddr = $derived(subject?.anon ? subject.lud16 || undefined : `${stripped}@${$page.url.host}`); - let profile = $derived(`${$page.url.host}/${subject.anon ? npub : stripped}`); - let lnurl = $derived( - encode( - "lnurl", - toWords( - new TextEncoder().encode(`https://${PUBLIC_DOMAIN}/p/${subject.anon ? npub : stripped}`), - ), - 20000, - ), - ); </script> <div class="container mx-auto w-full px-4 flex flex-wrap lg:flex-nowrap"> <div class="hidden lg:block lg:w-[280px] xl:w-[360px]"></div> <div class="w-full lg:w-[280px] xl:w-[360px] lg:absolute space-y-2 left-20 mx-auto"> - <div class="flex text-3xl font-bold text-center mx-auto justify-center gap-1 items-center"> - <button class="flex gap-1 items-center" onclick={toggleDetails}> - <div class="break-words">{display || username}</div> - <iconify-icon noobserver icon="ph:list-bold" width="32"></iconify-icon> - </button> + <div class="flex text-3xl font-bold text-center mx-auto justify-center gap-3 items-center"> + <div class="break-words">{display || username}</div> {#if subject.id === user?.id} - <a href="/settings/profile" class="btn contents" aria-label="Edit profile"> - <iconify-icon noobserver icon="ph:pencil-bold" width="32"></iconify-icon> + <a href="/settings/profile" class="flex items-center" aria-label="Profile settings"> + <iconify-icon noobserver icon="ph:faders-bold" width="32"></iconify-icon> </a> {:else} - <a href="/dm?username={subject.username}" class="btn contents" aria-label="Direct Message"> + <a href="/dm?username={subject.username}" aria-label="Direct Message"> <iconify-icon noobserver icon="ph:chat-bold" width="32"></iconify-icon> </a> {/if} @@ -92,100 +68,6 @@ </div> {/if} - {#if showDetails} - <div class="space-y-5"> - {#if lnaddr} - <div> - <div class="text-secondary">{$t("user.lightningAddress")}</div> - <div class="flex gap-4"> - <div class="break-all grow text-xl">{lnaddr}</div> - <div class="flex mb-auto gap-1"> - <button - type="button" - class="my-auto" - aria-label="Copy lightning address" - onclick={() => copy(lnaddr)} - > - <iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon> - </button> - <a - href={`/qr/${encodeURIComponent(lnaddr)}`} - class="my-auto" - aria-label="Show lightning address QR" - > - <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon> - </a> - </div> - </div> - </div> - {/if} - <div> - <div class="text-secondary">{$t("user.url")}</div> - <div class="flex gap-4"> - <div class="break-all grow text-xl">{profile}</div> - <div class="flex mb-auto gap-1"> - <button - type="button" - class="my-auto" - aria-label="Copy profile URL" - onclick={() => copy(profile)} - > - <iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon> - </button> - <a - href={`/qr/${encodeURIComponent(`${$page.url.protocol}//${profile}`)}`} - class="my-auto" - aria-label="Show profile URL QR" - > - <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon> - </a> - </div> - </div> - </div> - <div> - <div class="text-secondary">{$t("user.lnurl")}</div> - <div class="flex gap-4"> - <div class="break-all grow text-xl">{lnurl}</div> - <div class="flex mb-auto gap-1"> - <button - type="button" - class="my-auto" - aria-label="Copy LNURL" - onclick={() => copy(`lightning:${lnurl}`)} - > - <iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon> - </button> - <a - href={`/${n}/accepted/${encodeURIComponent(`lightning:${lnurl}`)}`} - class="my-auto" - aria-label="Show LNURL QR" - > - <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon> - </a> - </div> - </div> - </div> - <!-- <div> --> - <!-- <div class="text-secondary">{$t("user.nostrPubkey")}</div> --> - <!-- <div class="flex gap-4"> --> - <!-- <div class="break-all grow text-xl"> --> - <!-- {npub} --> - <!-- </div> --> - <!-- <div class="flex my-auto gap-1"> --> - <!-- <button class="my-auto" onclick={() => copy(npub)} --> - <!-- ><iconify-icon noobserver icon="ph:copy-bold" width="32" --> - <!-- ></iconify-icon></button --> - <!-- > --> - <!-- <a href={`/qr/${encodeURIComponent(npub)}`} class="my-auto"> --> - <!-- <iconify-icon noobserver icon="ph:qr-code-bold" width="32" --> - <!-- ></iconify-icon> --> - <!-- </a> --> - <!-- </div> --> - <!-- </div> --> - <!-- </div> --> - </div> - {/if} - <div class="flex flex-wrap gap-2 w-full text-lg"> <!-- {#if user && user.username !== subject.username && subject.pubkey} --> <!-- {#if following} --> |
